from Sort import Sort


class BubbleSort(Sort):
    """
        类描述：冒泡排序的实现
    """
    def __init__(self):
        super().__init__()

    def sort(self, arr_list):
        length = len(arr_list)
        for i in range(0, length - 1):
            for j in range(1, length - i):
                if arr_list[j - 1] > arr_list[j]:
                    Sort.swap(arr_list, j - 1, j)
        return arr_list


if __name__ == '__main__':
    arr = [2, 5, 3, 7, 1, 4]
    print(arr)
    sort = BubbleSort()
    print(sort.sort(arr))
